package com.cpkso.sprdata.domain;

import com.fasterxml.jackson.annotation.JsonView;

/**
 * spring mvc doc example
 * @author wrzhxy@qq.com
 * @date 2017年11月9日
 */
//@RestController
//public class UserController {
//
//        @GetMapping("/user")
//        @JsonView(User.WithoutPasswordView.class)
//        public User getUser() {
//                return new User("eric", "7!jd#h23");
//        }
//}
public class User {

    public interface WithoutPasswordView {};
    public interface WithPasswordView extends WithoutPasswordView {};

    private String username;
    private String password;

    public User() {
    }

    public User(String username, String password) {
            this.username = username;
            this.password = password;
    }

    @JsonView(WithoutPasswordView.class)
    public String getUsername() {
            return this.username;
    }

    @JsonView(WithPasswordView.class)
    public String getPassword() {
            return this.password;
    }
}
